package practice.tcp;

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.net.Socket;

public class 发送端 {
    public static void main(String[] args) throws Exception {
        //创建socket对象，表示与电脑的3333端口建立连接
        Socket socket = new Socket("localhost", 3333);
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        bw.write("史笔秀");
        bw.flush();
        socket.close();

    }
}
